/**
 * All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
 * <p>
 * PmReceiptApplyController
 * 项目收据申请
 * <p>
 * 修改纪录
 * 2020-05-21 版本：1.0 wushenghong 创建。
 *
 * @version 版本：1.0
 * @author 作者：wushenghong
 * 创建日期：2020-05-21
 */
package com.topscomm.pm.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.topscomm.basic.util.SQLAdapter;
import com.topscomm.pm.controller.auto.PmReceiptApplyControllerAuto;
import com.topscomm.pm.pojo.PmInvoiceApplyEntity;
import com.topscomm.pm.pojo.PmProjectEntity;
import com.topscomm.pm.pojo.PmReceiptApplyEntity;
import com.topscomm.pm.service.impl.PmProjectService;
import com.topscomm.pm.utils.MisStringUtil;
import com.topscomm.pub.util.*;
import com.topscomm.pub.vo.Page;
import com.topscomm.pub.vo.Query;
import com.topscomm.pub.vo.ResponseResult;
import com.topscomm.tap.ITapService;
import com.topscomm.tap.common.ParameterCache;
import com.topscomm.tap.common.TapSystemConst;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import javax.websocket.server.PathParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

/**
 * @author: wushenghong
 * @date: 2020-05-21
 * @description:项目收据申请Controller
 * @modify:
 */
@RestController
@RequestMapping("pm/receiptApply")
public class PmReceiptApplyController extends PmReceiptApplyControllerAuto implements IPmReceiptApplyController {
    @Resource
    private PmProjectService pmProjectService;
    /**
     * @param paraMap
     * @return
     * @author: wushenghong
     * @date: 2020-05-21
     * @description:转换出查询SQL语句
     * @modify:
     */
    @Override
    protected String spellListSql(Map<String, Object> paraMap) {
        StringBufferProxy sql = new StringBufferProxy();
        sql.appendSingle(" pmreceiptApply.enabled=1 ");
        if (paraMap.containsKey("qry_returnmoney")) {
            String value = paraMap.get("qry_returnmoney").toString();
            if (!StringUtil.isEmpty(value))
//                if ("0".equals(value)) {
//                    sql.appendSingle(" and returnmoney != 0");
//                } else if ("1".equals(value)) {
//                    sql.appendSingle(" and returnmoney = receiptmoney");
//                } else if ("2".equals(value)) {
//                    sql.appendSingle(" and returnmoney != receiptmoney and returnmoney != 0");
//                } else if ("3".equals(value)) {
//                    sql.appendSingle(" and returnmoney = 0");
//                }
                if ("0".equals(value)) {// 未回款完毕
                    sql.appendSingle(" and pmreceiptApply.returnmoney != pmreceiptApply.receiptmoney and pmreceiptApply.receiptcode is not null");
                } else if ("1".equals(value)) { // 回款完毕
                    sql.appendSingle(" and pmreceiptApply.returnmoney = pmreceiptApply.receiptmoney");
                }
        }
        if (paraMap.containsKey("qry_state")) {
            String value = paraMap.get("qry_state").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.state={0}", value);
        }
        if (paraMap.containsKey("qry_projectid")) {
            String value = paraMap.get("qry_projectid").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.projectid = {0} ", value);
        }
        if (paraMap.containsKey("qry_docno")) {
            String value = paraMap.get("qry_docno").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.docno like '%{0}%'", value);
        }
        if (paraMap.containsKey("qry_begindocdate")) {
            String value = paraMap.get("qry_begindocdate").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.docdate >= {0} ", SQLAdapter.toDateLong(value + " 00:00:00"));
        }
        if (paraMap.containsKey("qry_enddocdate")) {
            String value = paraMap.get("qry_enddocdate").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.docdate <= {0}", SQLAdapter.toDateLong(value + " 23:59:59"));
        }
        if (paraMap.containsKey("qry_deptname")) {
            String value = paraMap.get("qry_deptname").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.deptid in ( SELECT id from CboDept where fullname like '%{0}%'))", value);
        }
        if (paraMap.containsKey("qry_username")) {
            String value = paraMap.get("qry_username").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (username like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_deptcode")) {
            String value = paraMap.get("qry_deptcode").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.deptcode like '{0}%'", value);
        }
        if (paraMap.containsKey("qry_state")) {
            String value = paraMap.get("qry_state").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.state={0}", value);
        }
        if (paraMap.containsKey("qry_where")) {
            String value = paraMap.get("qry_where").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and {0}", value);
        }
        // 查询可以申请作废的单据。  进行收据重开时，可以重开“新增”和“重开”类型的收据
        if (paraMap.containsKey("qry_isnotcancel")) {
            String value = paraMap.get("qry_isnotcancel").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and iscancel = {0} and category in (1,3)", value);
        }
        if (paraMap.containsKey("qry_iscancel")) {
            String value = paraMap.get("qry_iscancel").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.iscancel = {0}", value);
        }
        if (paraMap.containsKey("qry_category")) {
            String value = paraMap.get("qry_category").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.category in ({0})", value);
        }
        // 发票统计查询条件
        if (paraMap.containsKey("qry_customername")) {
            String value = paraMap.get("qry_customername").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.customername like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_receiptcode")) {
            String value = paraMap.get("qry_receiptcode").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.receiptcode like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_couriernumber")) {
            String value = paraMap.get("qry_couriernumber").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.couriernumber like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_receiver")) {
            String value = paraMap.get("qry_receiver").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.receiver like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_receiptdateStart")) {
            String value = paraMap.get("qry_receiptdateStart").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.receiptdate >= {0} ", SQLAdapter.toDateLong(value + " 00:00:00"));
        }
        if (paraMap.containsKey("qry_receiptdateEnd")) {
            String value = paraMap.get("qry_receiptdateEnd").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.receiptdate <= {0}", SQLAdapter.toDateLong(value + " 23:59:59"));
        }
        sql .appendSingle(this.spellingSqlForProject(paraMap, "PmReceiptApply","projectid","id"));
        if (this.getUserBean().getUser().getAdminlevel() < 1)// 管理员、超级管理员，不控制权限
        {
            String dataPession = service.getDataPermission(TapSystemConst.TapOperationTypeEnum.Select, "", this.getUserBean());
            if (StringUtil.isEmpty(dataPession)) {
                sql.appendSingle(" and (" + MisStringUtil.createWhereByUsercodeFromProject(
                        this.getUserBean().getUser(), "projectid",
                        service.getDao().getTableName()) +
                                " or pmreceiptApply.usercode = '{0}')",
                        this.getUserBean().getUser().getCode());
            } else// 使用数据权限
            {
                sql.appendSingle(" and {0} ", dataPession);
            }
        }
        return sql.toString();
    }
    //=========================收据开具查询相关====================================================================================================
    protected String spellListSqlStatistics(Map<String, Object> paraMap) {
//        paraMap.put("qry_iscancel","0");
        StringBufferProxy sql = new StringBufferProxy();
        sql.appendSingle(" pmreceiptApply.enabled=1 ");
        // 收据统计查询条件
        if (paraMap.containsKey("qry_customername")) {
            String value = paraMap.get("qry_customername").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.customername like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_receiptcode")) {
            String value = paraMap.get("qry_receiptcode").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.receiptcode like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_couriernumber")) {
            String value = paraMap.get("qry_couriernumber").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.pmreceipt.couriernumber like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_receiver")) {
            String value = paraMap.get("qry_receiver").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and (pmreceiptApply.receiver like '%{0}%')", value);
        }
        if (paraMap.containsKey("qry_receiptdateStart")) {
            String value = paraMap.get("qry_receiptdateStart").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.receiptdate >= {0} ", SQLAdapter.toDateLong(value + " 00:00:00"));
        }
        if (paraMap.containsKey("qry_iscancel")) {
            String value = paraMap.get("qry_iscancel").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.iscancel = {0}", value);
        }
        if (paraMap.containsKey("qry_receiptdateEnd")) {
            String value = paraMap.get("qry_receiptdateEnd").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.receiptdate <= {0}", SQLAdapter.toDateLong(value + " 23:59:59"));
        }
        if (paraMap.containsKey("qry_projectid")) {
            String value = paraMap.get("qry_projectid").toString();
            if (!StringUtil.isEmpty(value))
                sql.appendSingle(" and pmreceiptApply.projectid = {0}", value);
        }
        if (paraMap.containsKey("qry_returnmoney")) {
            String value = paraMap.get("qry_returnmoney").toString();
            if (!StringUtil.isEmpty(value))
//                if ("0".equals(value)) {// 未回款完毕
//                    sql.appendSingle(" and pmreceiptApply.returnmoney != 0");
//                } else if ("1".equals(value)) { // 回款完毕
//                    sql.appendSingle(" and pmreceiptApply.returnmoney = receiptmoney");
//                } else if ("2".equals(value)) {
//                    sql.appendSingle(" and pmreceiptApply.returnmoney != receiptmoney and returnmoney != 0");
//                } else if ("3".equals(value)) {
//                    sql.appendSingle(" and pmreceiptApply.returnmoney = 0");
//                }
            if ("0".equals(value)) {// 未回款完毕
                sql.appendSingle(" and pmreceiptApply.returnmoney != pmreceiptApply.receiptmoney and pmreceiptApply.receiptcode is not null");
            } else if ("1".equals(value)) { // 回款完毕
                sql.appendSingle(" and pmreceiptApply.returnmoney = pmreceiptApply.receiptmoney");
            }
        }
        return sql.toString();
    }
    /**
     * 导出大数据量的excel
     *
     * @description:
     * @param paraMap
     * @param request
     * @param response
     * @author: donghang
     * @date: 2020年5月25日下午2:55:11
     * @modify:
     */
    @PostMapping(value = "/exportBigExcel")
    public ResponseResult<Object> exportBigExcel(@RequestBody(required = false) Map<String, Object> paraMap,
                                                 HttpServletRequest request, HttpServletResponse response) {
        paraMap = BaseUtil.decodeSecureMap(paraMap);
        String sidx = ConvertUtil.convertToString(paraMap.get("sidx"));
        String sord = ConvertUtil.convertToString(paraMap.get("sord"));
        String cols = ConvertUtil.convertToString(paraMap.get("cols"));
        cols= "rn;序号,"+cols;
        StringBufferProxy sql = new StringBufferProxy();
        // 默认导出非作废收据(未选择业务类型，则默认导出非作废单据)
        if (!paraMap.containsKey("qry_category")){
            paraMap.put("qry_category","1,3");
            paraMap.put("qry_iscancel","0");
        }
        sql.appendSingle(spellListSql(paraMap));
        Map<String, Object> queryMap = new HashMap<>();
        queryMap.put("whereSql", sql.toString());
        queryMap.put("sidx", sidx);
        queryMap.put("sord", sord);
        String fileName = ConvertUtil.convertToString(paraMap.get("fileName"));
        fileName = fileName.length() == 0 ? "收据导出.xlsx" : fileName + ".xlsx";
        List<Map<String, Object>> templist = this.service
            .queryMap(queryMap, "getPmReceiptApplyForExport");
        this.service.setDispFields(templist);
        String[] colArray = cols.split(",");
        try {
            // 导出数据
//            OfficeOperateUtil.exportExcelXlsx(response, this.service, queryMap, "getPmReceiptApplyForExport", fileName, cols,
//                    this.getUserBean().getUser().getId());
            InputStream inputStream = OfficeOperateUtil.exportExeclXlsx(templist, colArray);
            response.setContentType("application/octet-stream");
            response.setHeader("Content-Disposition",
                "attachment;filename=" + fileName);
            response.setHeader("FileName",
                URLEncoder.encode(fileName, "utf-8"));
            response.setHeader("Access-Control-Expose-Headers", "FileName");
            OutputStream outStream = response.getOutputStream();
            byte[] bytes = new byte[2048];
            int len;
            while ((len = inputStream.read(bytes)) != -1) {
                outStream.write(bytes, 0, len);
            }
            inputStream.close();
            return null;
        } catch (Exception ex) {
            return handleControllerException(ex);
        }
    }
    @GetMapping({"/listStatistics1"})
    public ResponseResult<Object> listStatistics1(@RequestParam(required = false) Map<String, Object> paraMap) {
        try {
            paraMap = BaseUtil.decodeSecureMap(paraMap);
            Query query = new Query(paraMap);
            String sqlWhere = this.spellListSqlStatistics(paraMap);
            int totalCount = ((ITapService)this.service).getCount(sqlWhere);
            List<Map<String, Object>> tempList = null;
            if (query.getPageSize() > 0) {
                tempList = ((ITapService)this.service).queryMapForPage(sqlWhere, query.getCurrentPage(), query.getPageSize(), query.getSidx(), query.getSord());
            } else {
                tempList = ((ITapService)this.service).queryMapByWhere(sqlWhere);
            }
            ((ITapService)this.service).setDispFields(tempList);
            Page page = new Page(tempList, totalCount, query.getPageSize(), query.getCurrentPage());
            return ResponseResult.ok(page);
        } catch (Exception var7) {
            return this.handleControllerException(var7);
        }
    }
    @GetMapping({"/listStatistics"})
    public ResponseResult<Object> listStatistics(@RequestParam(required = false) Map<String, Object> paraMap) {
        try {
            paraMap = BaseUtil.decodeSecureMap(paraMap);
            Query query = new Query(paraMap);
            String sqlWhere = this.spellListSqlStatistics(paraMap);
            Map<String, Object> cloneParam = ObjectUtil.clone(paraMap);
            cloneParam.put("whereSql",sqlWhere);
            int totalCount = this.service.getCount(cloneParam, "getCount");
            List<Map<String, Object>> tempList = null;
            Map<String, Object> paraMap2 = new HashMap<>();
            paraMap2.put("curPageIndex", query.getCurrentPage());
            int beginCount = query.getCurrentPage() * query.getPageSize() - query.getPageSize();
            paraMap2.put("begincount", beginCount);
            paraMap2.put("pagesize", query.getPageSize());
            paraMap2.put("sidx", query.getSidx());
            paraMap2.put("sord", query.getSord());
            paraMap2.put("whereSql", sqlWhere);
            if (query.getPageSize() > 0) {
                tempList = this.service.queryMapForPage(paraMap2, "getPmReceiptApplySum");
            } else
                tempList = this.service.queryMapByWhere(sqlWhere);
            this.service.setDispFields(tempList);
            Page page = new Page(tempList, totalCount, query.getPageSize(), query.getCurrentPage());
            return ResponseResult.ok(page);
        } catch (Exception ex) {
            return handleControllerException(ex);
        }
    }
    /**
     * @author: liwanpeng
     * @date: 2020-11-17
     * @param: paraMap
     * @return
     * @description: 强制修改，修改审批后的单据内容
     * @modify:
     */
    @PostMapping({"/modifyDoc"})
    public ResponseResult<Object> modifyDoc(@RequestBody(required = false) Map<String, Object> paraMap) {
        try {
            // 获取需要修改的单据的id
            String id = ConvertUtil.convertToString(paraMap.get("id"));
            // 获取需要修改的字段（key）
            List<String> listFielsQuery = new ArrayList<>(paraMap.keySet());
            // 查询原有单据信息
            PmReceiptApplyEntity pmReceiptApplyEntity = this.service.queryById(id);
            // 组装修改记录
            String s = MisStringUtil.generateModifyRecordJsonStr(this.getUserBean().getUser(), pmReceiptApplyEntity, paraMap);
            // 更新相关字段
            paraMap.put("modifyrecord",s);
            this.service.update(paraMap);
            return ResponseResult.ok("操作成功");
        } catch (Exception var8) {
            return this.handleControllerException(var8);
        }
    }
    //=========================收据开具查询相关结束====================================================================================================
    /**
     * @param paraMap
     * @return
     * @author: wushenghong
     * @date: 2020-05-21
     * @description:转换出查询SQL语句
     * @modify:
     */
    @Override
    @GetMapping(value = "/refList")
    public ResponseResult<Object> refList(@RequestParam(required = false) Map<String, Object> paraMap) {
        return super.refList(paraMap);
    }
    @Override
    protected void afterLoad(Map<String, Object> paraMap) {
        super.afterLoad(paraMap);
        String projectId = ConvertUtil.convertToString(paraMap.get("projectid"));
        PmProjectEntity pmProjectEntity = pmProjectService.queryById(projectId);
        paraMap.put("projectcode", pmProjectEntity.getCode());
        paraMap.put("projectcontractmoney", pmProjectEntity.getContractmoney());
        paraMap.put("projectmoney", pmProjectEntity.getProjectmoney());
        paraMap.put("projectrecbillmoney", pmProjectEntity.getRecbillmoney());
        paraMap.put("projectreceiptmoney", pmProjectEntity.getReceiptmoney());
        // 添加可修改审批后单据信息的人员code系统参数
        paraMap.put("modifyReceiptUserCode", ParameterCache.getValue("modifyreceiptusercode"));
    }
    // 取消审批
    @DeleteMapping({"/delApproval"})
    public ResponseResult<Object> delApproval(@RequestBody(required = false) Map<String, Object> paraMap) {
        ResponseResult responseResult = super.delApproval(paraMap);
        if (responseResult.isSuccess()) {
            String id = ConvertUtil.convertToString(paraMap.get("id"));
            this.service.updateReceiptMoneyOfProjectBase(id, false);
            return ResponseResult.ok("取消审批成功");
        }
        return responseResult;
    }
    /**
     * @param dataMap
     * @param paraMap
     * @throws Exception
     * @description: 提交审批前
     * @author: wushenghong
     * @date: 2020-05-21
     * @modify:
     */
    @Override
    protected void beforeSubmit(Map<String, Object> dataMap, Map<String, Object> paraMap) throws Exception {
        super.beforeSubmit(dataMap, paraMap);
        StringBufferProxy mailtitle = new StringBufferProxy();
        mailtitle.appendSingle("{0}{1}于{2}提交项目收据申请申请,单据编号{3}! ", dataMap.get("dispdeptcode"), dataMap.get("username"), DateUtil.dateToString(new Date(), "yyyy-MM-dd"), dataMap.get("docno"));
        dataMap.put("maintitle", mailtitle.toString());
        List<Map<String, Object>> flowidList = flowDatacodeCache.getApprovalFlowListMap("ApprovalFlow_PmReceiptApply", dataMap.get("deptcode").toString(),dataMap.get("usercode").toString(),null, "sortcode");
        Long flowid = flowidList.size()>0? ConvertUtil.convertToLong(flowidList.get(0).get("id")) :null;
        dataMap.put("flowid", flowid);
    }

    @Override
    @GetMapping({"/list"})
    public ResponseResult<Object> list(@RequestParam(required = false) Map<String, Object> paraMap) {
        try {
            paraMap = BaseUtil.decodeSecureMap(paraMap);
            Query query = new Query(paraMap);
            String sqlWhere = this.spellListSql(paraMap);
            paraMap.put("whereSql",sqlWhere);
            int totalCount = this.service.getCount(paraMap,"getReceiptAndProjectCount");
            List<Map<String, Object>> tempList = null;
            HashMap<String, Object> paraMap2 = new HashMap<>();
            paraMap2.put("curPageIndex",query.getCurrentPage());
            int beginCount=query.getCurrentPage()*query.getPageSize()-query.getPageSize();
            paraMap2.put("begincount",beginCount);
            paraMap2.put("pagesize", query.getPageSize());
            paraMap2.put("sidx", query.getSidx());
            paraMap2.put("sord", query.getSord());
            paraMap2.put("whereSql", sqlWhere);
            if (query.getPageSize() > 0) {
                tempList = this.service.queryMapForPage(paraMap2,"getReceiptAndProject");
            } else {
                tempList = this.service.queryMap(paraMap2,"queryMapByWhere1");
            }
            this.service.setDispFields(tempList);
            Page page = new Page(tempList, totalCount, query.getPageSize(), query.getCurrentPage());
            return ResponseResult.ok(page);
        } catch (Exception var7) {
            return this.handleControllerException(var7);
        }
    }



    /**
     * @author: wudaliang
     * @date: 2021-07-27
     * @description:  物流系统回写收据信息
     * @return: com.topscomm.pub.vo.ResponseResult<java.lang.Object>
     * @modify:
     */
    @PostMapping("/receiveLogisticsInfo")
    public String updateByDeliver(@RequestParam(value="content") String paraMap) throws Exception {
        Map<String,Object> map = JSONObject.parseObject(paraMap,Map.class);
        JSONObject response = new JSONObject();
        if(map.containsKey("deliveryStateCode")){
            int state = ConvertUtil.convertToInt(map.get("deliveryStateCode"));
            if(state>=50){
                try {
                    this.service.updateReceiptByDelivery(ConvertUtil.convertToString(map.get("sourceDocNo")),ConvertUtil.convertToString(map.get("mailNo")),ConvertUtil.convertToDate(map.get("deliveryTime")),ConvertUtil.convertToString(map.get("expressCode")));
                    response.put("result","success");
                    response.put("errorMessage","物流系统调用接口成功！");
                    return JSONObject.toJSONString(response);
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new Exception(e.getMessage());
                }
            }
            response.put("result","fail");
            response.put("errorMessage","物流系统调用接口失败，物流系统传递参数deliveryStateCode小于50，请联系管理员！");
            return JSONObject.toJSONString(response);
        }else{
            response.put("result","fail");
            response.put("errorMessage","物流系统传递的deliveryStateCode字段有误，请校验！");
            return JSONObject.toJSONString(response);
        }
    }


}
